home *** CD-ROM | disk | FTP | other *** search
- /**
- AEFX_UiLib.c
-
- Part of the Adobe After Effects 3.1 SDK
- Copyright (c)1993-96, Adobe Systems Inc, All Rights Reserved.
-
- Revision History
- 1.0, created by dmw
- **/
-
- #include "AEFX_UILib.h"
-
- Boolean CreateOffscreenBitMap (GWorldPtr *newOffscreen, short depth, Rect *inBounds)
- {
- GWorldPtr oldPort;
- GDHandle oldDev;
- OSErr err;
- GWorldPtr newWorld;
-
- GetGWorld(&oldPort, &oldDev);
-
- err = NewGWorld(&newWorld, depth, inBounds, NULL, NULL, 0);
- if (!err) {
- LockPixels(newWorld->portPixMap);
- SetGWorld(newWorld, NULL);
- EraseRect(inBounds);
- UnlockPixels(newWorld->portPixMap);
- *newOffscreen = newWorld;
- } else {
- *newOffscreen = NULL;
- }
-
- SetGWorld(oldPort, oldDev);
- if (err) return FALSE;
- else return TRUE;
-
- } // CreateOffscreenBitMap
-
-
-
- void DestroyOffscreenBitMap (GWorldPtr oldOffscreen)
- {
- DisposeGWorld((GWorldPtr)oldOffscreen);
-
- } // DestroyOffscreenBitMap
-
-
-
- void InvalidateWorld (GWorldPtr offscreen, GDHandle gdH)
- {
- GWorldPtr saveWorld;
- GDHandle saveDevice;
- Rect r;
-
- GetGWorld(&saveWorld, &saveDevice);
-
- SetGWorld(offscreen, gdH);
- r = offscreen->portRect;
- EraseRect(&r);
- FrameRect(&r);
- MoveTo(r.left, r.top);
- LineTo(r.right, r.bottom);
-
- MoveTo(r.right, r.top);
- LineTo(r.left, r.bottom);
-
- SetGWorld(saveWorld, saveDevice);
-
- }
-